On the Sina Weibo homepage, you can see that the time displayed after each microblog is not in the standard year-month-day format, but the time difference after conversion, for example: published five minutes ago and two hours ago, similar functions
On the Sina Weibo homepage, you can see that the time displayed after each microblog is not in the standard year-month-day format, but the time difference after conversion, for example: posted 5 minutes ago and 2 hours ago, it looks more intuitive
To implement similar functions, use JS as follows:
I. javascript function implementation:Instance 1:Copy codeThe Code is as follows:// JavaScript Functions:Var minute = 1000*60;Var hour = minute * 60;Var day = hour * 24;Var halfamonth = day * 15;Var
Front-end time personalization plugin Jquery.timeago.jsKeywords:time formatting just n minutes ago N hours ago N days ago N months ago N years agoMm-dd hh:mm or Yyyy-mm-ddFront End:
spanclass="time" title="2016-07-23 12:02:32">span>
Ten years ago, the pie of pie Xi Shi is still so positive (zz)
Mail station: Shui mu
Community (Wed Oct 27 13:55:05 2010), Station
Get up, brush your teeth, wash your face, 8.5 straight to the convenience canteen. The pie-packed iron plate is
To achieve similar functions, using JS can be implemented as follows:
One, JavaScript function implementation:Example 1:
Copy Code code as follows:
JavaScript functions:
var minute = 1000 * 60;
var hour = minute * 60;
var day = hour *
Timestamp is a small feature that we often use in comparison of time and date, next, I will introduce some methods for converting the strtotime Timestamp and use it to format a date several minutes, several hours ago, or several days ago. Timestamp
1. The PHP timestamp function converts a date to a unix timestamp.Doomsday timestamp PHP The code is as follows: Copy code Echo "doomsday timestamp:". strtotime ("2012-12-21 ")
The words in EnglishHttp://baike.baidu.com/link?url=m0OPtbtNefU-EtIVp-spB0UOi467l9JwEUtWQjW1Ao9yoi9QOPIzwYf7sulq7LgQmVPpBB95lxH9yDIewR2zMaA noun (or other form) modifies another noun or pronoun, limiting or stating that the noun (or other form) is a
Original title: Focus on the word is dead! There's no need for this group to exist.Think that is too right, turn around to show you, the original link: focus on the word is dead! There's no need for this group to exist.All recite words by vocabulary,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.